From 7522af5c6ae4aa4db6ab95ac7fc7029ded4f7bae Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Fri, 25 Nov 2005 17:12:12 +0000 Subject: [PATCH] Only write a success node when coming online, not going offline. Delete the interface from the bridge when going offline -- the comment stating that interfaces are auto-removed does not seem to be true, at least some of the time. Log failure of brctl delif and ifconfig down only at debug level, as this script may be called more than once, depending upon the hotplug configuration. Signed-off-by: Ewan Mellor --- tools/examples/vif-bridge | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/examples/vif-bridge b/tools/examples/vif-bridge index 69f1a670d7..5144339498 100755 --- a/tools/examples/vif-bridge +++ b/tools/examples/vif-bridge @@ -61,12 +61,16 @@ case "$command" in ;; offline) - # vifs are auto-removed from bridge. - ifconfig "$vif" down || log err "ifconfig $vif down failed" + brctl delif "$bridge" "$vif" || + log debug "brctl delif $bridge $vif failed" + ifconfig "$vif" down || log debug "ifconfig $vif down failed" ;; esac handle_iptable -log debug "Successful vif-bridge operation for $vif, bridge $bridge." -success +log debug "Successful vif-bridge $command for $vif, bridge $bridge." +if [ "$command" == "online" ] +then + success +fi -- 2.30.2